import type { ConsultType } from "@/enum";
import type { PartialConsult } from "@/types/consult";
import { defineStore } from "pinia";
import { ref } from "vue";
export const useConsultStore = defineStore('cp-consult',()=>{
//定义响应式数据来保存问诊的数据
const consult = ref<PartialConsult>({})
//定义函数收集就诊的类型
const setType = (type:ConsultType) =>{
    consult.value.type = type
}
//定义函数收集极速问诊类型 0普通 1三甲
const setIllnessType = (type:0 | 1) =>{
    consult.value.illnessType = type
}
const setDepId = (id:string) => {
    consult.value.depId = id
}
return {
    consult,
    setType,
    setIllnessType,
    setDepId
}
},
{
    persist:true
}
)